
<?php 
if (!empty($numall)) echo "<div style=\"float:right;\">".pagenav_cc($numall, $page, $Url, $NumPerPage)."</div>";
?>

<h1>Документы</h1>
<?php

$N_subcats=GetChildCategory("docs","");
if (!empty($N_subcats)) {
	
	
	$numall=count($N_subcats);
	$i=0;
	
	echo "<ul style='text-align:left; border-bottom:1px dashed #ccc; padding-bottom:60px;'>";
	//print_r($N_subcats);
	foreach ($N_subcats as $cat) {
	//print_r($cat);
	//echo($CatID);
	if ($CatID==$cat['ID']) $t_cat="font-weight:bold; color:#ff6600";
	else $t_cat="";
?>
	<li style="float:left; margin-left:20px; margin-bottom:10px;"><?php
	?><a  style="font-size:14px; <?=$t_cat?>" href="/docs/c-<?php echo $cat['uname'] ?>/"><img src="<?=$design_path?>images/ico-category.png" alt="">&nbsp;<?php echo $cat['CatName'] ?></a></li>  


<?
	$i++;
	}//foreach ($N_subcats as $cat)
	echo "</ul><div class='clearfix'></div>";
	
}//if (!empty($N_subcats)) {

?>

<br/><br/><br/>
<div id="list"  class="thumbnails" style="">
<?php


				
if (!empty($NewsData)) {
$catname[0]="";
$i=1;
$num=count($NewsData);
foreach ($NewsData as $News) {
if (!empty($News['uname'])) $NewURL=$News['uname'];
else $NewURL=$News['ID'];


if (getfileext($News['docfile'])=="doc" or getfileext($News['docfile'])=="docx") $img="file-doc.png";
else if (getfileext($News['docfile'])=="rtf" or getfileext($News['docfile'])=="RTF") $img="file-doc.png";
else if (getfileext($News['docfile'])=="pdf" or getfileext($News['docfile'])=="PDF") $img="file-pdf.png";
else if (getfileext($News['docfile'])=="gif" or getfileext($News['docfile'])=="jpg") $img="file-image.png";
else if (getfileext($News['docfile'])=="ppt") $img="file-ppt.png";
else if (getfileext($News['docfile'])=="zip") $img="file-zip.png";
else if (getfileext($News['docfile'])=="xls" or getfileext($News['docfile'])=="xlsx") $img="file-xls.png";
else $img="file-blank.png";


?>
   <ins class="thumbnail" id="new">
	<div class="r">
		<div class="newsc">
			
			<div id="files">
			<div class="img">
			<a name="file-<?=$News['ID']?>"></a>
			<a href="<?=$News['docfile']?>"><img src="<?php echo($design_path)."images/".$img; ?>" alt="test" ></a></div>
			<a href="<?=$News['docfile']?>" title="<?php echo($News['title']) ?>"><?php 
			
			echo wordwrap(substr($News['title'], 0, 87), 50, "<br />\n");  
			
			?>...</a>
			<span>Размер: <span style="color:green;"><?php echo getfilesize(FS_DOCROOT.$News['docfile']) ?></span>;
			Тип: <span style="color:green;">*.<?php echo getfileext(FS_DOCROOT.$News['docfile']) ?></span></span>
		</div>
			
		</div>
		<div class="clearfix"></div>
	</div>

	
	</ins>

<?
$i++;
}//foreach
?>
<br/><br/>
<?
if (!empty($numall)) echo pagenav_cc($numall, $page, $Url, $NumPerPage);

}//if
else echo "Документов нет или произошла ошибка.";

?>
</div>
